package klk.shop.z.kev.tools;

import java.io.CharArrayWriter;
import java.io.IOException;
import java.io.PrintWriter;

import javax.servlet.http.HttpServletResponse;
import javax.servlet.http.HttpServletResponseWrapper;

public class ResponseWrapper extends HttpServletResponseWrapper {
	private CharArrayWriter buffer;

	public ResponseWrapper(HttpServletResponse response) {
		super(response);
		buffer = new CharArrayWriter();
	}

	@Override
	public PrintWriter getWriter() throws IOException {
		return new PrintWriter(buffer);
	}

	public String getContent() {
		return buffer.toString();
	}
	public void setContent(String s) {
		buffer = new CharArrayWriter();
		buffer.append(s);
	}

}
